package com.example.lottery.service.dto;

import com.example.lottery.controller.param.ActivityCreateParam;
import com.example.lottery.service.enums.ActivityEnum;
import com.example.lottery.service.enums.ActivityPrizeEnum;
import com.example.lottery.service.enums.ActivityUserEnum;
import com.example.lottery.service.enums.PrizeTiersEnum;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class ActivityDetailDTO {
    /**
     * 活动Id
     */
    private Long activityId;

    /**
     * 活动名称
     */

    private String activityName;
    /**
     * 活动描述
     */
    private String description;
    /**
     * 活动状态
     */
    private ActivityEnum status;

    /**
     * 圈选奖品信息 多个
     */
    private List<ActivityDetailDTO.PrizeDTO> activityPrizeList;
    /**
     * 圈选人员信息 多个
     */
    private List<ActivityDetailDTO.UserDTO> activityUserList;

    //判断状态是否为INIT 初始化状态
    public boolean valid(){
        return this.status.name().equalsIgnoreCase(ActivityEnum.RUNNING.name());
    }
    @Data
    public static class PrizeDTO implements Serializable {
        /**
         * 奖品id
         */

        private Long prizeId;
        /**
         * 奖品数量
         */

        private Long prizeAmount;
        /**
         * 奖品等级
         */

        private PrizeTiersEnum prizeTiers;

        /**
         * 奖品状态
         */
        private ActivityPrizeEnum status;

        //奖品详情
        private String name;

        private String description;

        private BigDecimal price;

        private String imageUrl;

        //判断状态是否为INIT 初始化状态
        public boolean valid(){
           return this.status.name().equalsIgnoreCase(ActivityPrizeEnum.INIT.name());
        }

    }
    @Data
    public static class UserDTO implements Serializable{
        /**
         * 用户id
         */

        private Long userId;
        /**
         * 用户名称
         */

        private String userName;

        /**
         * 奖品状态
         */
        private ActivityUserEnum status;

        //判断状态是否为INIT 初始化状态
        public boolean valid(){
            return this.status.name().equalsIgnoreCase(ActivityUserEnum.INIT.name());
        }
    }

}
